package com.room.mapper;

import com.room.pojo.Apartment;
import com.room.pojo.College;
import com.room.pojo.vo.CollegeVO;
import com.room.pojo.vo.StudentVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CollegeMapper {
    int deleteByPrimaryKey(String collegeId);

    int insert(College record);

    int insertSelective(College record);

    College selectByPrimaryKey(String collegeId);

    int updateByPrimaryKeySelective(College record);

    int updateByPrimaryKey(College record);

    //获取所有学院用来初始化下来列表
    List<College> getAllCollege();

    //展示数据
    List<College> getCollegeByPage(Integer start,Integer size);


    //获取总数
    @Select("select count(*) from college")
    Long getCollegeCount();

    //导出学生数据到excel
    @Select({
            "SELECT "
                    +"s.college_id as collegeId,"
                    +"s.college_name as collegeName"
                    +" FROM"
                    +" college s"
    })
    List<CollegeVO> getAllCollegeVO();

 //根据id删除学生数据
    int deleteColById(@Param("ids")String[] ids);

    //获取学院最大编号
    String getMaxId();

    @Select("select college_name from college where college_id = #{collegeId}")
    String getCollegeNameByCollegeId(@Param("collegeId") String collegeId);
}